<!doctype html>
<html lang="zh-CN">
<head>
	<title>字符云监控开源版</title>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<script language="javascript" src="<?cs var:config.dwzpath?>js/jquery-1.7.2.js"></script>
	<script src="<?cs var:config.dwzpath?>js/dmt.comm.js" type="text/javascript"></script>
	<script language="javascript" src="<?cs var:config.dwzpath?>js/jquery.md5.js"></script>
	<script language="javascript" src="<?cs var:config.dwzpath?>js/jquery.cookie.js"></script>
	<meta name="keywords" content="字符云监控系统,云监控系统,监控提醒,日志系统,云日志系统,日志汇聚,多云部署">
	<meta name="description" content="字符云监控系统-多云部署一站监控,一切尽在掌握!">
	<meta name="author" content="rockdeng,1820140912@qq.com,qq:1820140912">
	<meta name="renderer" content="webkit">
	<link rel="icon" href="/monitor/themes/default/images/zifu_48.ico">
	
	<style type="text/css">
	body,th{margin:0; padding:0; font-family:Tahoma,"宋体"; font-size:12px; color:#003399}
	a{text-decoration:none; color:#003399}
	a:hover{text-decoration:underline}
	
	#wrapper{background:url(<?cs var:config.img_path ?>bg.jpg) repeat-x; width:100%; height:430px}
	#head{width:100%}
	#biao{ float:right; margin:0; padding:0; width:149px; height:63px}
	#logo{ width:332px; height:63px}
	#logo span{display:block}
	#logo a{display:block;width:332px; height:63px}
	
	#inbox{background:url(<?cs var:config.img_path ?>inbox_bg.jpg) no-repeat; width:474px; height:340px; margin-left:auto; margin-right:auto;}
	#error{width:260px; border:1px solid #666666; background:#fff; margin-left:auto; margin-right:auto; margin-top:20px; padding:3px; color:#CC0000;}
	#error_infor{width:90%; margin:auto;}
	
	#loginbox{width:100%; margin-left:10px; margin-top:10px;}
	#title{
		padding:2px 0 0px 5px;
		font-weight:bold;
		font-size:13px;
		margin:0 0 5px 30px;
	}
	#enter{height:110px; font-size:14px; font-weight:bold}
	#enter_box{width:270px; margin:20px 0 0px 50px}
	#botton{width:100%;text-align:center;float: left;margin-top:4px;}
	#loginmsg{
		width:320px;
		float: left;
		text-align:center;
		margin-left:20px;
		margin-top:8px;
	}
	#ip{width:120px; float:left; padding:5px 0 0 5px}
	#footer{font:10px Tahoma; margin-top:2px}
	.inputclass{border:1px solid #eeeeee; font-size:14px; font-family:Tahoma; font-weight:bold}
	</style>
	
	<script language="javascript" type="text/javascript">
		var g_req_timestamp = 0;
		var g_login_in_cust_server = 0;

		function login_submit()
		{
			if ($('#username').val() == ""){
				$('#loginmsg').html('<font style="font-size:12px;" color="#ff0000">请输入用户名</font>');
				$('#username').focus();
				return;
			}
			if ($('#password').val() == ""){
				$('#loginmsg').html('<font style="font-size:12px;" color="#ff0000">请输入密码</font>');
				$('#password').focus();
				return;
			}
			document.getElementById("btn_login").disabled = true;
			
			var requrl = "<?cs var:config.cgipath?>slog_flogin";
			var reqpara = {};
			reqpara.username = $('#username').val();
			var input_passwd = $('#password').val();
			var pass_md5 = $.md5(input_passwd);
			reqpara.password = pass_md5;
			reqpara.action = "check";
			reqpara.response_method = "json";
			reqpara.redirect_url = "<?cs var:config.redirect_url ?>";
			reqpara.login_type = 0;

			var d = new Date();
			g_req_timestamp = d.getTime();

			$('#loginmsg').html('<font style="font-size:12px;">正在验证用户身份……</font>');
			$.ajax({
				url:requrl, 
				data:reqpara, 
				success:function(result){
					document.getElementById("btn_login").disabled = false;
					switch (result.code) {
						case 0:
							document.location = result.redirect_url;
							break;
						case 8:
							if(g_login_in_cust_server != 0) {
								$('#loginmsg').html('<font style="font-size:12px;" color="#ff0000">系统错误，请稍后刷新网页重试。</font>');
							}
							else {
								window.location = result.cust_login_server;; 
							}
							break;
						default:
							$('#loginmsg').html('<font style="font-size:12px;" color="#ff0000">用户名或密码错误！</font>');
							$('#username').focus();
							break;
						}
					}, 
				error:function(q,errmsg,err){
						document.getElementById("btn_login").disabled = false;
						var hm = '<font style="font-size:12px;" color="#ff0000">验证失败，服务器异常！';
						hm += "错误信息：" + errmsg;
						hm += '</font>'
						$('#loginmsg').html(hm);
					},
				dataType:'json'
			});	
		}

		function clear_input()
		{
			$('#password').val("");
			$('#username').val("");
			$('#loginmsg').html("");
			$('#username').focus();
		}

		$(document).ready(function(){
			$('#username').focus();
		}).keydown(function(event){
			if(event.keyCode==13){
				login_submit();
				return false;
			}
		});
	</script>
</head>

<body>
<div id="wrapper">
	<div id="head">
		<div id="biao"></div>
		<div id="logo"></div>
	</div>
	
	<div id="inbox">
		<div style="height:90px;"></div>
		<form name= "login" action="#" method="get"> 
			<div id="loginbox">
				<div id="title" align="center"><p align="left">字符云监控开源版用户登录</p></div>
			  	<div id="enter">
						<div id="enter_box">
						用户名：<input id="username" type="text" class="inputclass" size="20" maxlength="20" >
						</div>
						<div id="enter_box">
						密　码：<input id="password" type="password" class="inputclass" size="20" maxlength="20" >
						</div>
						<div id="loginmsg"></div>
				</div>
		  	</div>
			<div id="botton" align="center" valign='center'>
				<input type="button" id="btn_login" value=" 登 录 "  onClick="login_submit()" />
				<input type="button" value=" 重 填 "  onClick="clear_input()" />
			</div>
		</form>
	</div>

	<!-- 以下代码为演示版所需，您可以删除掉 -->
	<?cs if:config.isdaemon == 1 ?>
	<div align='center' style='margin-left:-50px'>
		<font style='font-size:16px;margin-left:-40px'>当前可用的演示账号(登录密码同用户名)</font> <br>
		<br>
		<table border='1'>
			<tr><th width="100px">用户名</th><th width="100px">用户类型</th></tr>
		<?cs each:ulist=Output.freelists ?>
			<tr>
				<td align='center'><?cs var:ulist.uname ?></td>
				<?cs if:ulist.utype == 1 ?>
				<td align='center'>管理员</td>
				<?cs else ?>
				<td align='center'>普通账号</td>
				<?cs /if ?>
			</tr>
		<?cs /each ?>
		</table>
		<div style='margin-left:-60px;'> 
			<ul> 
				<li>
					<a href='http://xrkmonitor.com' target='_blank'>
						<font style='font-size:17px; font-weight:bold'>字符云监控在线云版</font>
					</a>
				</li>
				<li>
					<a href='http://xrkmonitor.com' target='_blank'>
						<font style='font-size:17px; font-weight:bold'>开源版源码下载链接</font>
					</a>
				</li>
				<li>
					<a href='http://xrkmonitor.com' target='_blank'>
						<font style='font-size:17px; font-weight:bold'>开源版在线视频文档</font>
					</a>
				</li>
			</ul>
		</div>
	</div>
	<?cs /if ?>
</div>
</body>
</html>

